package shmallarchitect.jpa.entities;
// Generated 2009-08-23 21:22:13 by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Owner generated by hbm2java
 */
@Entity
@Table(name="owner"
    ,catalog="shmall_architect"
)
public class Owner  implements java.io.Serializable {


     private Long id;
     private String name;
     private String phone;
     private String email;
     private Set<Gallery> galleries = new HashSet<Gallery>(0);
     private Set<Locum> locums = new HashSet<Locum>(0);

    public Owner() {
    }

	
    public Owner(String email) {
        this.email = email;
    }
    public Owner(String name, String phone, String email, Set<Gallery> galleries, Set<Locum> locums) {
       this.name = name;
       this.phone = phone;
       this.email = email;
       this.galleries = galleries;
       this.locums = locums;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id", unique=true, nullable=false)
    public Long getId() {
        return this.id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    @Column(name="name")
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    @Column(name="phone")
    public String getPhone() {
        return this.phone;
    }
    
    public void setPhone(String phone) {
        this.phone = phone;
    }
    
    @Column(name="email", nullable=false)
    public String getEmail() {
        return this.email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="owner")
    public Set<Gallery> getGalleries() {
        return this.galleries;
    }
    
    public void setGalleries(Set<Gallery> galleries) {
        this.galleries = galleries;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="owner")
    public Set<Locum> getLocums() {
        return this.locums;
    }
    
    public void setLocums(Set<Locum> locums) {
        this.locums = locums;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Owner other = (Owner) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 47 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return name;
    }




}


